import request from '@/utils/request'

/**
 * 虚拟教室相关接口
 */

export default {
  /**
   * 获取虚拟教室成绩列表
   * @param {Object} params 查询参数 {student_name, student_phone, status, project_name, page, page_size}
   * @returns Promise
   */
  getVirtualScores(params) {
    return request({
      url: '/teacher/virtual-scores',
      method: 'get',
      params
    })
  },

  /**
   * 获取虚拟课堂列表
   * @param {Object} params 查询参数
   * @returns Promise
   */
  getClassroomList(params) {
    return request({
      url: '/teacher/virtual-classrooms',
      method: 'get',
      params
    })
  },

  /**
   * 创建虚拟课堂
   * @param {Object} data 虚拟课堂数据
   * @returns Promise
   */
  createClassroom(data) {
    return request({
      url: '/teacher/virtual-classrooms',
      method: 'post',
      data
    })
  },

  /**
   * 更新虚拟课堂
   * @param {Object} data 虚拟课堂数据
   * @returns Promise
   */
  updateClassroom(data) {
    return request({
      url: '/teacher/virtual-classrooms',
      method: 'put',
      data
    })
  },

  /**
   * 删除虚拟课堂
   * @param {Number} id 虚拟课堂ID
   * @returns Promise
   */
  deleteClassroom(id) {
    return request({
      url: `/teacher/virtual-classrooms/${id}`,
      method: 'delete'
    })
  }
}